package com.chenjun.core.vo.activiti;

import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.util.Date;

import org.springframework.beans.BeanUtils;
import org.springframework.format.annotation.DateTimeFormat;

import com.chenjun.core.dao.generator.entity.OaBillLeaveApplication;

@SuppressWarnings("serial")
public class LeaveDto implements Serializable {

	private Integer id;

	private String note;

	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date leaveBeginTime;

	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date leaveEndTime;
	
	private Integer leaveTypeId;

	public String getNote() {
		return note;
	}


	public void setNote(String note) {
		this.note = note;
	}


	public Date getLeaveBeginTime() {
		return leaveBeginTime;
	}


	public void setLeaveBeginTime(Date leaveBeginTime) {
		this.leaveBeginTime = leaveBeginTime;
	}


	public Date getLeaveEndTime() {
		return leaveEndTime;
	}


	public void setLeaveEndTime(Date leaveEndTime) {
		this.leaveEndTime = leaveEndTime;
	}

	public Integer getId() {
		return id;
	}


	public void setId(Integer id) {
		this.id = id;
	}


	public Integer getLeaveTypeId() {
		return leaveTypeId;
	}


	public void setLeaveTypeId(Integer leaveTypeId) {
		this.leaveTypeId = leaveTypeId;
	}


	/**
	 * 根据Bean获取Model模型
	 * @return
	 * PayBean
	 * @throws InvocationTargetException 
	 * @throws IllegalAccessException 
	 */
	public static LeaveDto getDtoByModel(OaBillLeaveApplication source) throws IllegalAccessException, InvocationTargetException{
		LeaveDto target = new LeaveDto();
		BeanUtils.copyProperties(source, target);
		return target;
	}
	
	
	/**
	 * 根据Model获取Bean模型
	 * @return
	 * PayBean
	 * @throws InvocationTargetException 
	 * @throws IllegalAccessException 
	 */
	public static OaBillLeaveApplication getModelByDto(LeaveDto source) throws IllegalAccessException, InvocationTargetException{
		OaBillLeaveApplication target = new OaBillLeaveApplication();
		BeanUtils.copyProperties(source, target);
		return target;
	}

}
